<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<%@include file="/view/common/common.jsp"%>
<script type="text/javascript" src="../js/echarts.min.js"></script>

	<style type="text/css">
		* {
			margin: 0;
			padding:0;
		}

		.container {
			width: 100%;
			padding-left: 35px;
		}

		.box1 {
			width: 30%;
			height: 150px;
			float: left;
			margin-top: 50px;
			margin-left: 20px;
			margin-right: 20px;
			background: #F2F2F2;
		}

		.box1 .title {
			text-align: center;
			margin-top: 30px;
			font-size: 15px;
		}

		.box1 .content {
			margin-top: 20px;
			text-align: center;
			font-size: 30px;
		}

		.clearfix:after{
			content: "020";
			display: block;
			height: 0;
			clear: both;
			visibility: hidden;
		}

		.clearfix {
			/* 触发 hasLayout */
			zoom: 1;
		}
	</style>
	<script type="text/javascript">
		function formatType(val, row) {
			if (val == '0') {
				return '普通转账';
			} else if(val == '1') {
				return '扫码转账';
			}
		}
		/* 0-待收款，1-待付款，2-待确认，3-已取消，4-已成交 */
		function formatStatusData(val, row){
			if (val == '0') {
				return '待收款';
			} else if(val == '1') {
				return '待付款';
			}else if(val == '2') {
				return '待确认';
			}else if(val == '3') {
				return '已取消';
			}else if(val == '4') {
				return '已成交';
			}
		}
	</script>

</head>
<body style="height: 100%; margin: 0">
        <div id="container" style="width: 1000px;height:400px;"></div>

		<div  class="clearfix"></div>
		<label>本周转账明细</label>
		<table id="tab" class="easyui-datagrid"  style="height:auto;width:auto;" url="${ctx}/transfer/getTransferRelationRecordWeek.do"
			   rownumbers="true" pagination="true"  singleSelect="true"  >
			<thead>
			<tr>
				<th field="nick_name_out"  width="80" align="center">转出方</th>
				<th field="phone_out" width="110" align="center">转出方手机号</th>
				<th field="ifip_out" width="100" align="center">转出IFIP</th>
				<th field="ifiv_out" width="100" align="center">转出方IFIV收益</th>
				<th field="nick_name_in" width="80" align="center">转入方</th>
				<th field="phone_in" width="110" align="center">转入方手机号</th>
				<th field="ifip_in" width="105" align="center">转入方IFIP收益</th>
				<th field="ifiv_in" width="105" align="center">转入方IFIV收益</th>
				<th field="type" width="105" align="center" data-options="formatter:formatType">类型</th>
				<th field="create_time"  width="135" align="center">创建时间</th>
			</tr>
			</thead>
		</table>


		<br/>
		<label>本周订单成交明细</label>
		<table id="tab2" class="easyui-datagrid"  style="height:auto;width:auto;" url="${ctx}/tOrder/getTOrderRelationListWeek.do"
			   rownumbers="true" pagination="true"  singleSelect="true"  >
			<thead>
			<tr>
				<th field="order_no"  width="150" align="center">订单号</th>
				<th field="money" width="40" align="center">金额</th>
				<th field="trade_num" width="50" align="center">交易数量</th>
				<th field="platform_price" width="40" align="center">平台价</th>
				<th field="create_time" width="130" align="center">创建时间</th>
				
				<th field="nick_name_out" width="60" align="center" >卖方</th>
				<th field="phone_out" width="100" align="center" >卖方手机号</th>
				<th field="ifip_out" width="50" align="center" >卖方IFIP</th>
				<th field="ifiv_out" width="50" align="center" >卖方IFIV</th>
				<th field="status_out" width="50" align="center" data-options="formatter:formatStatusData" >卖方状态</th>
			 
				<th field="nick_name_in" width="60" align="center" >买方</th>
				<th field="phone_in" width="100" align="center" >买方手机号</th>
				<th field="ifip_in" width="50" align="center" >买方IFIP</th>
				<th field="ifiv_in" width="50" align="center" >买方IFIV</th>
				<th field="status_in" width="50" align="center" data-options="formatter:formatStatusData" >买方状态</th>
			</tr>
			</thead>
		</table>
		
		<br/>
		<label>本周兑换明细</label>
		<table id="tab2" class="easyui-datagrid"  style="height:auto;width:auto;" url="${ctx}/user/getExchangeListWeek.do"
			   rownumbers="true" pagination="true"  singleSelect="true"  >
			<thead>
			<tr>
				<th field="nick_name"  width="160" align="center">昵称</th>
				<th field="phone" width="160" align="center">手机号</th>
				<th field="uid" width="160" align="center">uid</th>
				<th field="ifip" width="160" align="center">兑换矿晶</th>
				<th field="ifiv" width="160" align="center">获得矿场</th>
				<th field="create_time" width="225" align="center" >创建时间</th>
			</tr>
			</thead>
		</table>
		
		
		

<script type="text/javascript">

var dom = document.getElementById("container");
var myChart = echarts.init(dom);

var nums=[];

var url ='${ctx}/statistic/statisticCount.do';	
$.post(url,function(result){
	var result = eval('(' + result + ')');
	if (result.isSuc) {
		nums.push(result.data.regCountToday);
		nums.push(result.data.regCountWeek);
		nums.push(result.data.transferCountToday);
		nums.push(result.data.transferCountWeek);
		nums.push(result.data.tradeCountToday);
		nums.push(result.data.tradeCountWeek);
		nums.push(result.data.exchangeCountToday);
		nums.push(result.data.exchangeCountWeek);
		
		myChart.hideLoading();
	      myChart.setOption({
	   	  xAxis: {
	   	        type: 'category',
	   	        data: ['当天注册人数', '本周注册人数', '当天转账次数', '本周转账次数', '当天交易次数', '本周交易次数', '当天兑换次数','本周兑换次数']
	   	    },
	   	    yAxis: {
	   	        type: 'value'
	   	    },
	   	    series: [{
	   	    	data: nums,
	   	    	label: {
	  		      normal: {
	  		          show: true,
	  		          position: 'top',
	  		          textStyle: {
	  		            color: 'red'
	  		          }
	  		      }
	  		},
	   	        type: 'bar'
	   	    }]
      })
	}
}) 
</script>



</body>
</html>